package cn.schoolwow.starter.quickdao;

import cn.schoolwow.quickdao.transaction.Transaction;
import org.springframework.transaction.support.TransactionSynchronizationManager;

public class QuickDAOTransactionHolder {
    /**
     * 获取关联事务对象
     * */
    public static Transaction getTransaction(){
        QuickDAOTransactionObject quickDAOTransactionObject = (QuickDAOTransactionObject) TransactionSynchronizationManager.getResource(QuickDAOTransactionManager.QUICKDAO_RESOURCE_KEY);
        return quickDAOTransactionObject.getTransaction();
    }
}
